package follow.juc.demo;

public class Test {
    public static void main(String[] args) {

        System.out.println("餐馆开张了");

        Restaurant restaurant = new Restaurant();
        new Thread(() -> {
            for (int i = 0; i < 5; i++) {
                restaurant.cut();
            }
        }).start();
        new Thread(() -> {
            for (int i = 0; i < 5; i++) {
                restaurant.cook();
            }
        }).start();
        new Thread(() -> {
            for (int i = 0; i < 5; i++) {
                restaurant.serving();
                System.out.println("第" + i + "道菜完成");
            }
        }).start();
    }
}
